package com.youlu.campus.activity.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.youlu.campus.activity.repositories.UserDailyLearningRepository;
import com.youlu.campus.activity.service.UserDailyLearningService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户学习签到 服务实现类
 *
 * @Description: UserDailyLearningServiceImpl
 * @Date 2025/10/11
 * @module UserDailyLearningServiceImpl
 * @author: su
 */
@Slf4j
@Service
public class UserDailyLearningServiceImpl implements UserDailyLearningService {

    @Autowired
    private UserDailyLearningRepository repository;

    @Override
    public void deleteByUserIdAndActivityId(String userId, String activityId) {
        log.info("deleteByUserIdAndActivityId userId:{},activityId:{}", userId, activityId);
        Long deleteResult = repository.deleteByUserIdAndActivityId(userId, activityId);
        log.info("deleteByUserIdAndActivityId deleteResult:{}", JSONObject.toJSONString(deleteResult));
    }
}
